package 设计模式.observer.util;

/**
 * @功能
 * @创建时间 2020/5/4
 */
public class Cline {
    public static void main(String[] args) {
        ConcreteSubject subject = new ConcreteSubject();
        ObserA obs1 = new ObserA();
        ObserA obs2 = new ObserA();
        ObserA obs3 = new ObserA();

        subject.addObserver(obs1);
        subject.addObserver(obs2);
        subject.addObserver(obs3);

        subject.set(300);
        System.out.println(obs1.getMyState());
        System.out.println(obs3.getMyState());
        System.out.println(obs2.getMyState());
    }
}
